<% if false # the license inside this if block assertains to this file -%>
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
<% end -%>

Google Cloud Platform for Chef
--------------------------------

This cookbook installs all Google cookbooks for Chef to allow managing
[Google Cloud Platform][gcp] resources from your Chef environment

#### Table of Contents

1. [Description](#description)
2. [Setup](#setup)
3. [Supported Google Cloud Platform Products][supported-products]
4. [Summary of Supported Products Types / Providers][supported-types]
5. [Supported Operating Systems](#supported-operating-systems)


## Description

This cookbook is a convenience to install all Google Cloud Platform cookbooks
for Chef with a single command. You can install them individually if you wish
as well.


## Setup

To install this cookbook, insert the following into your Berksfile.

    cookbook 'google-cloud', '~> <%= manifest.version -%>'

## Supported Google Cloud Platform Products

The `google/cloud` cookbook installs the following cookbooks automatically:

<%=
  lines(indent(
          product_details.map { |p| p[:name] }
                         .map { |p| "- [#{p}](##{p.downcase.tr(' ', '-')})" }, 2
       ))
-%>
  - [Google Authentication](#google-authentication)


## Summary of Supported Products Types / Providers

Below you can find a summary of each supported type and a brief description of
its intended behavior. For full details about each provider, properties,
parameters, usage and examples please visit its respective Chef cookbook project
page.

<% product_details.each do |product| -%>

### <%= product[:name] -%>

Detailed information can be found at the
[google-<%= product[:prefix] -%>][] project home page.
<% unless product[:objects].nil? -%>
The list below is a summary of the supported types by the cookbook:

<% product[:objects].each do |object| -%>

- `<%= object.out_name -%>`
<%= wrap_field(object.description, 2) -%>

<% end # objects.nil? -%>
<% end # objects.each -%>
<% end # products.each -%>

### Google Authentication

This cookbook provides the types to authenticate with Google Cloud Platform.
When executing operations on Google Cloud Platform, e.g. creating a virtual
machine, a SQL database, etc., you need to be authenticated to be able to carry
on with the request.  All Google Cloud Platform cookbooks use an unified
authentication mechanism, provided by this cookbook.

For examples, installation and usage visit the [google-gauth][] cookbook home
page.


## Supported Operating Systems

<table>
  <tr><th>Product</th><th>Operating Systems</th></tr>
<% products.map do |product, config| -%>
<%   os_list = config.manifest.operating_systems -%>
  <tr>
    <td><%= product.name -%></td>
    <td>
<%= indent(os_list.map(&:all_versions).join("<br/>\n"), 6) %>
    </td>
  </tr>
<% end # products.map -%>
</table>


[supported-products]: #supported-google-cloud-platform-products
[supported-types]: #summary-of-supported-products-types--providers
<%=
  lines(product_details.map do |product|
          "[google-#{product[:prefix]}]: #{product[:source]}"
        end)
-%>
[google-gauth]: https://github.com/GoogleCloudPlatform/chef-google-auth/blob/master/README.md
[gcp]: https://cloud.google.com
